set iverilog_path=C:\iverilog\bin;
set gtkwave_path=C:\iverilog\gtkwave\bin;
set path=%iverilog_path%%gtkwave_path%%path%

set source_module=add
set testbentch_module=add_tb

iverilog -o output/%testbentch_module%.vvp -y src/ -I src/ sim/%testbentch_module%.v
vvp -n output/%testbentch_module%.vvp -lxt2
iverilog -tvhdl -o output/%source_module%.vhd -y src/ -I src/ src/%source_module%.v

set gtkw_file=output/%testbentch_module%.gtkw
if exist %gtkw_file% (gtkwave %gtkw_file%) else (gtkwave output/%testbentch_module%.vcd)

pause